package com.xjoyt.pay.merchant.register.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xjoyt.pay.controllers.AbstractController;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.merchant.register.interfaces.MerchantRateContract;
import com.xjoyt.pay.merchant.register.params.MerchantRatePageParam;
import com.xjoyt.pay.merchant.register.po.Merchant;
import com.xjoyt.pay.merchant.register.po.MerchantRate;
import com.xjoyt.pay.merchant.register.services.MerchantRateService;

@RestController
@RequestMapping("merchantRate")
public class MerchantRateController extends AbstractController implements MerchantRateContract  {

	@Autowired
	private MerchantRateService service;
	
	@Override
	public ExecuteResult<?> saveRate(@RequestBody com.xjoyt.pay.master.vo.MerchantRateMap param) {
		return service.saveRate(param);
	}

	@Override
	public ExecuteResult<Merchant> check(@PathVariable("id") String id, @PathVariable("enabled") Boolean enabled) {
		
		return service.check(id, enabled);
	}

	@Override
	public PageResult<com.xjoyt.pay.merchant.register.vo.MerchantRate> loadPage(@RequestBody PageParam<MerchantRatePageParam> param) {
		
		return null;
	}
	
	@Override
	public ExecuteResult<MerchantRate> save(@RequestBody com.xjoyt.pay.master.po.MerchantRate param) {
		return service.save(param);
	}

}